import request from '@/utils/request'

// 获取四性方案列表
export function getPlanList(query) {
  return request({
    url: '/archive/detectionScheme/list',
    method: 'get',
    params: query
  })
}

// 查询门类树列表
export function listGROUPTree(query) {
  return request({
    url: '/archive/category/getcatemodeltree',
    method: 'get',
    params: query
  })
}

// 获取四性方案详情
export function getPlanDetail(id) {
  return request({
    url: '/archive/detectionScheme/'+ id,
    method: 'get'
  })
}

// 新增四性方案
export function addPlan(data) {
  return request({
    url: '/archive/detectionScheme',
    method: 'post',
    data: data
  })
}

// 修改四性方案
export function updatePlan(data) {
  return request({
    url: '/archive/detectionScheme',
    method: 'put',
    data: data
  })
}

// 删除四性方案
export function deletePlan(id) {
  return request({
    url: '/archive/detectionScheme/'+ id,
    method: 'delete'
  })
}

// 获取是否有详情
export function getDetail(query) {
  return request({
    url: '/archive/detectionObject/detail',
    method: 'get',
    params: query
  })
}

// 修改获取配置
export function getConfigurationDetail(id) {
  return request({
    url: '/archive/detectionObject/'+ id,
    method: 'get'
  })
}

// 新增获取配置
export function getConfiguration(query) {
  return request({
    url: '/archive/detectionScheme/tree',
    method: 'get',
    params: query
  })
}

// 配置页面各项配置值接口
export function getObject(query) {
  return request({
    url: '/archive/detectionScheme/objectTree',
    method: 'get',
    params: query
  })
}

// 获取元数据方案
export function getSchemelist(query) {
  return request({
    url: '/archive/detectionScheme/getSchemelist',
    method: 'get',
    params: query
  })
}

// 获取档号规则
export function getDh(query) {
  return request({
    url: '/archive/detectionScheme/getDh',
    method: 'get',
    params: query
  })
}

// 保存配置
export function saveDetectionObject(data) {
  return request({
    url: '/archive/detectionObject',
    method: 'post',
    data: data
  })
}
